<div bsModal #createOrEditModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="createOrEditModal"
  aria-hidden="true" [config]="{backdrop: 'static'}">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <form *ngIf="active" #editForm="ngForm" novalidate (ngSubmit)="save()" autocomplete="off">
        <div class="modal-header">
          <h4 class="modal-title">
            <span *ngIf="equipment.id">编辑资源</span>
            <span *ngIf="!equipment.id">创建新的资源</span>
          </h4>
          <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body">

          <div class="form-group">
            <label for="equipName">设备名称 *</label>
            <input id="equipName" #equipNameInput="ngModel" type="text" name="equipName" class="form-control"
              [(ngModel)]="equipment.equipName" required>
            <validation-messages [formCtrl]="equipNameInput"></validation-messages>
          </div>

          <div class="form-group">
            <label for="code">设备编号 *</label>
            <input id="code" #codeInput="ngModel" type="text" name="code" class="form-control" [(ngModel)]="equipment.code"
              required>
            <validation-messages [formCtrl]="codeInput"></validation-messages>
          </div>

          <div class="form-group">
            <label for="teamGroup">使用班组 *</label>
            <select id="teamGroup" class="form-control" name="teamGroupId" [(ngModel)]="equipment.teamGroupId" required>
              <option *ngFor="let teamGroup of teamGroups" value="{{teamGroup.value}}">{{teamGroup.displayText}}</option>
            </select>
          </div>

          <div class="form-group">
              <label for="equipCapacity">能力类型 *</label>
              <select id="equipCapacity" class="form-control" name="equipCapacity" [(ngModel)]="equipment.equipCapacity"
                required>
                <option value="false">单能力</option>
                <option value="true">多能力</option>
              </select>
            </div>

            <!-- <div class="form-group">
              <label for="isHeatEquip">是否为热处理设备 *</label>
              <select id="isHeatEquip" class="form-control" name="isHeatEquip" [(ngModel)]="equipment.isHeatEquip"
                required>
                <option value="false">否</option>
                <option value="true">是</option>
              </select>
            </div> -->

          <div class="form-group">
            <label for="usingUnit">使用单位</label>
            <input id="usingUnit" type="text" name="usingUnit" class="form-control" [(ngModel)]="equipment.usingUnit">
          </div>

          <div class="form-group">
            <label for="resPerson">负责人</label>
            <input id="resPerson" type="text" name="resPerson" class="form-control" [(ngModel)]="equipment.resPerson">
          </div>

          <div class="form-group">
            <label for="remark">备注</label>
            <textarea id="remark" class="form-control" type="text" name="remark" [(ngModel)]="equipment.remark" rows="3"></textarea>
          </div>
        </div>
        <div class="modal-footer">
          <button [disabled]="saving" type="button" class="btn btn-default" (click)="close()">{{l("Cancel")}}</button>
          <button type="submit" class="btn btn-primary" [disabled]="!editForm.form.valid" [buttonBusy]="saving"
            [busyText]="l('SavingWithThreeDot')"><i class="fa fa-save"></i> <span>{{l("Save")}}</span></button>
        </div>
      </form>
    </div>
  </div>
</div>
